﻿@model IEnumerable<AuditModel.ExpertJudge>

@{
    var grid = new WebGrid(source: Model, defaultSort: "SerialNumber", rowsPerPage:20);

}
@if (User.IsInRole("管理员"))
{
@grid.GetHtml(
        columns: grid.Columns(
            grid.Column("SerialNumber", AuditResources.ExpertJudge.SerialNumber),
            grid.Column("RealName", AuditResources.ExpertJudge.RealName),
            grid.Column("Subject.Name", AuditResources.ExpertJudge.SubjectId),
            grid.Column("Phone", AuditResources.ExpertJudge.Phone),
            grid.Column("ContactAddress", AuditResources.ExpertJudge.ContactAddress),
            grid.Column("ZipCode", AuditResources.ExpertJudge.ZipCode),
            grid.Column("UserId", string.Empty, format: @<text>@Html.ActionLink(AuditResources.UI.Edit, "Edit", new { id = item.UserID }, new { @class = "button" }) | @Html.ActionLink(AuditResources.UI.Details, "Details", new { id = item.UserID }, new { @class = "button" }) | @Html.ActionLink(AuditResources.UI.Delete, "Delete", new { id = item.UserID }, new { @class = "button" }) | @Html.ActionLink(AuditResources.Account.ResetPassword, "ResetPassword", new { id = item.UserID },  new { @class = "button", onclick="return confirm('确定要重设密码吗？')" }) </text>)
        ))
}
else
{
    @grid.GetHtml(
        columns: grid.Columns(
            grid.Column("SerialNumber", AuditResources.ExpertJudge.SerialNumber),
            grid.Column("RealName", AuditResources.ExpertJudge.RealName),
            grid.Column("Subject.Name", AuditResources.ExpertJudge.SubjectId),
            grid.Column("Phone", AuditResources.ExpertJudge.Phone),
                grid.Column("ContactAddress", AuditResources.ExpertJudge.ContactAddress),
                grid.Column("ZipCode", AuditResources.ExpertJudge.ZipCode)
        ))
}
